<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App',
  mounted () {
    if (this.isMobile()) {
      this.$router.replace('/m.home')
    } else {
      this.$router.replace('/home')
    }
  },
  methods: {
    isMobile () {
      const flag = navigator.userAgent.match(
        /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
      )
      localStorage.setItem('ismobile', flag ? 1 : 0)
      return flag
    }
  }
}
</script>

<style lang="less">
body,html,#app {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-weight: 400;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
a,img {
  text-decoration: none;
  -webkit-user-drag: none;
  cursor: pointer;
}
ul,ol {
  list-style: none;
}
/*导航条美化*/
::-webkit-scrollbar {
  width: 3px;
  height: 3px;
  background-color: #ededed;
}
::-webkit-scrollbar-track {
    box-shadow: inset 0 0 0px #ededed;
    border-radius: 10px;
  background-color: #ededed;
}
::-webkit-scrollbar-thumb {
  border-radius: 10px;
    box-shadow: inset 0 0 0px #ededed;
    background-color: #ededed;
}
</style>
